using System;

namespace PetShop.Web.Entities
{
    [Serializable]
    public class CartItemInfo
    {
       

        private readonly string _itemId;
        private readonly string _name;
        private readonly decimal _price;
        private bool _inStock;
        private int _quantity = 1;


        public CartItemInfo(string itemId)
        {
            _itemId = itemId;
        }


        public CartItemInfo(string itemId, string name, bool inStock, int qty, decimal price)
        {
            _itemId = itemId;
            _name = name;
            _quantity = qty;
            _price = price;
            _inStock = inStock;
        }


        public int Quantity
        {
            get { return _quantity; }
            set { _quantity = value; }
        }

        public bool InStock
        {
            get { return _inStock; }
            set { _inStock = value; }
        }

        public decimal Subtotal
        {
            get { return (_quantity*_price); }
        }

        public string ItemId
        {
            get { return _itemId; }
        }

        public string Name
        {
            get { return _name; }
        }

        public decimal Price
        {
            get { return _price; }
        }
    }
}